﻿<?php
$ms_mt_td = $_REQUEST['mt_td']; //lấy giá trị request từ biến mt_td
//select ra dòng của mẩu tin có mã số là $ms_mt_td
mysql_query("SET character_set_results=utf8");
$rs=mysql_query("SELECT *, DATE_FORMAT(han_chot,'%d-%m-%Y') AS han_nop_hs FROM mau_tin_td a, linh_vuc_td b WHERE a.ms_linh_vuc = b.ms_linh_vuc AND a.ms_mau_tin_td='$ms_mt_td'");
$rw=mysql_fetch_array($rs);
$ms_linh_vuc = $rw[1];
//$ten_dn = $rw[2];
$ten_nha_td = $rw[3];
$vi_tri_tuyen = $rw[4];
$noi_lam_viec = $rw[5];
$noi_dung = $rw[6];
$ngay_dang = date("Y-m-d");
$noi_dang = $rw[8];
$han_chot = $rw[17];
//$logo = $rw[10];
$thoi_gian_song = $rw[11];
$dia_chi = $rw[12];
$sdt = $rw[13];
$email = $rw[14];
?>
<div class="article">
<form name="sua_mt_td" action="" method="post" enctype="multipart/form-data">
<table width="80%" border="0" cellspacing="0" cellpadding="0" align="center" bordercolor="#FF0000">
  <tr>
    <td colspan="2" align="center" class="title_stt">CẬP NHẬT MẨU TIN TUYỂN DỤNG</td>
  </tr>
   <tr>
    <td>Mã số mẩu tin: </td>
    <td><input type="text" readonly="readonly" value="<?php echo $ms_mt_td;?>" ></input></td>
  </tr>
  <tr>
    <td>Lĩnh vực tuyển dụng: </td>
    <td>
        <select name="linh_vuc" size="1" id="linh_vuc" spry:selected="<?php echo $ms_linh_vuc;?>" >
            <?php
            include "connect.php";
                $ros=mysql_query("SELECT DISTINCT ms_linh_vuc, ten_linh_vuc FROM linh_vuc_td");
                while ($row=mysql_fetch_array($ros)){
            ?>
            <option value="<?php echo $row['ms_linh_vuc']; ?>" <?php if($row['ms_linh_vuc']==$ms_linh_vuc){echo "selected='selected'";};?> ><?php echo $row['ten_linh_vuc']; ?></option>
            <?php	
                }
            ?>
        </select>
     </td>
  </tr>
  <tr>
    <td>Tên nhà tuyển dụng: </td>
    <td><input type="text" name="ten_nha_td" id="ten_nha_td" value="<?php echo $ten_nha_td;?>" ></input></td>
  </tr>
  <tr>
    <td>Vị trí cần tuyển: </td>
    <td><input type="text" name="vi_tri" id="vi_tri" value="<?php echo $vi_tri_tuyen;?>" ></input></td>
  </tr>
  <tr>
    <td>Nơi làm việc: </td>
    <td><input type="text" name="noi_lam_viec" id="noi_lam_viec" value="<?php echo $noi_lam_viec;?>" ></input></td>
  </tr>
  <tr>
    <td>Yêu cầu tuyển dụng: </td>
    <td><textarea id="yeu_cau" name="yeu_cau" rows="8" cols="50" ><?php echo $noi_dung;?></textarea></td>
  </tr>
  <tr>
    <td>Nơi đăng: </td>
    <td>
        <select name="noi_dang" size="1" id="noi_dang" >
        <?php
			$arr = array("Cần Thơ", "Vĩnh Long", "Đồng Tháp");
			$n = count($arr);
			$i=0;
			for($i=0;$i<$n;$i++){
		?>
          <option value="<?php echo $arr[$i];?>" <?php if($arr[$i]==$noi_dang){echo "selected='selected'";};?> ><?php echo $arr[$i];?></option>
        <?php
			}
		?>
        </select>
    </td>
  </tr>
  <tr>
    <td>Hạn chót nộp hồ sơ: </td>
    <td>
        <input name="han_chot" type="text" id="date" readonly="readonly" value="<?php echo $han_chot;?>" />
        <a href="javascript:viewcalendar()">
            Lịch
        </a>
    </td>
  </tr>
  <tr>
    <td>Thời gian tồn tại: </td>
    <td><input type="text" name="thoi_gian_song" id="thoi_gian_song" value="<?php echo $thoi_gian_song;?>" ></input></td>
  </tr>

   </tr>
	<tr>
    <td>Địa chỉ:</td>
    <td><input name="dia_chi" id="dia_chi" type="text" value="<?php echo $dia_chi; ?>"/></td>
  </tr>
  <tr>
    <td>Số điện thoại:</td>
    <td><label>
      <input type="text" name="sdt" id="sdt" value="<?php echo $sdt;?>"  onblur=""/>
    </label></td>
 </tr>
 <tr>
    <td>Email:</td>
    <td><input name="email" id="email" type="text" value="<?php echo $email ?>"/></td>
  </tr>
<tr>
    <td colspan="2" align="center">
        <input type="submit" name="submit" id="submit" value="Cập nhật"/>
      	<input type="button" name="back" id="back" value="Trở lại" onClick="location.href='ds_mau_tin_td.php';" />
      </td>
  </tr>
</table>
</div>
